package com.reitgn.project.service;

import java.util.Collection;
import java.util.List;

import org.springframework.stereotype.Component;

import com.bstek.bdf2.core.orm.hibernate.HibernateDao;
import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.data.provider.Page;
import com.reitgn.project.entity.Demo;

@Component("demoDao")
public class DemoDao extends HibernateDao {
   
	@DataProvider
	public void load(Page<Demo> page) throws Exception{
		String hql=" from "+Demo.class.getName()+"";
//		Collection<Demo> list = this.query(hql);
//		page.setEntities(list);
//		page.setEntityCount(this.queryForInt(hql));
		this.pagingQuery(page, hql, "select count(*) "+hql);
	}
	
}
